package main

import (
	"fmt"
	"sort"
)

func main() {

	drink := map[string]string{
		"Coke":    "可乐",
		"Sprite":  "雪碧",
		"Brandy":  "白兰地",
		"Whiskey": "威士忌",
	}

	fmt.Println("饮料的名字：")
	for key, _ := range drink {
		fmt.Println(key)
	}

	fmt.Println()
	fmt.Println("英文和汉语：")
	for key, value := range drink {
		fmt.Printf("%s  :  %s  \n", key, value)
	}

	keys := make([]string, len(drink))
	i := 0
	for k, _ := range drink {
		keys[i] = k
		i++
	}

	sort.Strings(keys)
	fmt.Println()
	fmt.Println("排序后：")
	for _, v := range keys {
		fmt.Printf("%s  :  %s  \n", v, drink[v])
	}

}
